import Vue from 'vue'
import Router from 'vue-router'

//订单列表
const index = r => require.ensure([], () => r(require('@/components/index')), 'index')

//商品列表
const prcList = r => require.ensure([], () => r(require('@/components/prcList')), 'prcList')
const prcAdd = r => require.ensure([], () => r(require('@/components/prcAdd')), 'prcAdd')

//广告列表
const bannerList = r => require.ensure([], () => r(require('@/components/bannerList')), 'bannerList')
const bannerAdd = r => require.ensure([], () => r(require('@/components/bannerAdd')), 'bannerAdd')

//会员列表
const userList = r => require.ensure([], () => r(require('@/components/userList')), 'userList')

//信息列表
const spanFaithList = r => require.ensure([], () => r(require('@/components/spanFaithList')), 'spanFaithList')
const spanFaithAdd = r => require.ensure([], () => r(require('@/components/spanFaithAdd')), 'spanFaithAdd')
const spanIndList = r => require.ensure([], () => r(require('@/components/spanIndList')), 'spanIndList')
const spanIndAdd = r => require.ensure([], () => r(require('@/components/spanIndAdd')), 'spanIndAdd')
const spanOcList = r => require.ensure([], () => r(require('@/components/spanOcList')), 'spanOcList')
const spanOcAdd = r => require.ensure([], () => r(require('@/components/spanOcAdd')), 'spanOcAdd')
const spanTipList = r => require.ensure([], () => r(require('@/components/spanTipList')), 'spanTipList')
const spanTipAdd = r => require.ensure([], () => r(require('@/components/spanTipAdd')), 'spanTipAdd')


Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/userList',
      component: userList
    },
    {
      path: '/prcList',
      component: prcList
    },
    {
      path: '/prcAdd',
      component: prcAdd
    },
    {
      path: '/bannerList',
      component: bannerList
    },
    {
      path: '/bannerAdd',
      component: bannerAdd
    },

    {
      path: '/spanFaithList',
      component: spanFaithList
    },
    {
      path: '/spanFaithAdd',
      component: spanFaithAdd
    },
    {
      path: '/spanIndList',
      component: spanIndList
    },
    {
      path: '/spanIndAdd',
      component: spanIndAdd
    },
    {
      path: '/spanOcList',
      component: spanOcList
    },
    {
      path: '/spanOcAdd',
      component: spanOcAdd
    },
    {
      path: '/userList',
      component: userList
    },
    {
      path: '/spanTipList',
      component: spanTipList
    },
    {
      path: '/spanTipAdd',
      component: spanTipAdd
    }
  ]
})
